import { ref, onMounted } from 'vue'
import axios from 'axios'
export default function useLoading() {
    const isLoding = ref(true)
    const imgUrl = ref<string>('')
    onMounted(() => {
        axios.get("https://api.thecatapi.com/v1/images/search")
            .then((res) => {
                imgUrl.value = res.data[0].url
                isLoding.value = false
            })
            .catch((e) => {
                console.log(e.message);
            })
    })
    return {
        isLoding,
        imgUrl
    }
}